package com.bean;

import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author wangLin
 * @version 1.0
 * @projectName spring-wl
 * @className People
 * @date 2021-03-16 周二
 * @time 9:51
 * @description TODO
 */

@Data
public class People {

    private int id;
    private String name;

    @Autowired
    private Rice rice;

    public People() {
        System.out.println("调用People无参数的构造方法------------1");
    }

    public void eat() {
        rice.showName();
    }

    public void eatRice(User user, Rice rice) {
        System.out.println(user.getUsername() + "吃饭:");
        rice.showName();
    }

}
